package com.ruoyi.system.service.impl;

import com.ruoyi.common.core.domain.entity.system.SysTaocanOrder;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.mapper.SysTaocanOrderMapper;
import com.ruoyi.system.service.ISysTaocanOrderService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 套餐计费订单Service业务层处理
 *
 * @author zjw
 * @date 2023-08-22
 */
@Service
public class SysTaocanOrderServiceImpl implements ISysTaocanOrderService {
    @Resource
    private SysTaocanOrderMapper sysTaocanOrderMapper;

    /**
     * 查询套餐计费订单
     *
     * @param orderId 套餐计费订单主键
     * @return 套餐计费订单
     */
    @Override
    public SysTaocanOrder selectSysTaocanOrderByOrderId(String orderId) {
        return sysTaocanOrderMapper.selectSysTaocanOrderByOrderId(orderId);
    }

    /**
     * 查询套餐计费订单列表
     *
     * @param sysTaocanOrder 套餐计费订单
     * @return 套餐计费订单
     */
    @Override
    public List<SysTaocanOrder> selectSysTaocanOrderList(SysTaocanOrder sysTaocanOrder) {
        return sysTaocanOrderMapper.selectSysTaocanOrderList(sysTaocanOrder);
    }

    /**
     * 新增套餐计费订单
     *
     * @param sysTaocanOrder 套餐计费订单
     * @return 结果
     */
    @Override
    public int insertSysTaocanOrder(SysTaocanOrder sysTaocanOrder) {
        sysTaocanOrder.setCreateTime(DateUtils.getNowDate());
        return sysTaocanOrderMapper.insertSysTaocanOrder(sysTaocanOrder);
    }

    /**
     * 修改套餐计费订单
     *
     * @param sysTaocanOrder 套餐计费订单
     * @return 结果
     */
    @Override
    public int updateSysTaocanOrder(SysTaocanOrder sysTaocanOrder) {
        return sysTaocanOrderMapper.updateSysTaocanOrder(sysTaocanOrder);
    }

    /**
     * 批量删除套餐计费订单
     *
     * @param orderIds 需要删除的套餐计费订单主键
     * @return 结果
     */
    @Override
    public int deleteSysTaocanOrderByOrderIds(String[] orderIds) {
        return sysTaocanOrderMapper.deleteSysTaocanOrderByOrderIds(orderIds);
    }

    /**
     * 删除套餐计费订单信息
     *
     * @param orderId 套餐计费订单主键
     * @return 结果
     */
    @Override
    public int deleteSysTaocanOrderByOrderId(String orderId) {
        return sysTaocanOrderMapper.deleteSysTaocanOrderByOrderId(orderId);
    }

    @Override
    public SysTaocanOrder queryUnpaidOrder(Long userId) {
        return sysTaocanOrderMapper.queryUnpaidOrder(userId);
    }

    @Override
    public SysTaocanOrder queryToUseOrder(Long userId) {
        return sysTaocanOrderMapper.queryToUseOrder(userId);
    }

    @Override
    public SysTaocanOrder queryUsingOrder(Long userId) {
        return sysTaocanOrderMapper.queryUsingOrder(userId);
    }

    @Override
    public SysTaocanOrder queryInProgressOrder(Long userId) {
        return sysTaocanOrderMapper.queryInProgressOrder(userId);
    }

    @Override
    public List<SysTaocanOrder> queryFulfilledOrder(Long userId) {
        return sysTaocanOrderMapper.queryFulfilledOrder(userId);
    }

    @Override
    public List<SysTaocanOrder> queryAllOrder(Long userId) {
        return sysTaocanOrderMapper.queryAllOrder(userId);
    }
}
